home *** CD-ROM | disk | FTP | other *** search
/ Apple WWDC 1996 / WWDC96_1996 (CD).toast / Technology Materials / MacOS 8 Resources / Developer Tools / Mac OS 8 Interfaces & Libraries / Interfaces / AIncludes / Processes.a < prev    next >
Text File  |  1996-05-01  |  9KB  |  326 lines

  1. ;
  2. ;    File:        Processes.a
  3. ;
  4. ;    Contains:    Process Manager Interfaces.
  5. ;
  6. ;    Version:    Technology:    System 7.5
  7. ;                Release:    Universal Interfaces 3.0d3 on Copland DR1
  8. ;
  9. ;    Copyright:    © 1984-1996 by Apple Computer, Inc.  All rights reserved.
  10. ;
  11. ;    Bugs?:        If you find a problem with this file, send the file and version
  12. ;                information (from above) and the problem description to:
  13. ;
  14. ;                    Internet:    apple.bugs@applelink.apple.com
  15. ;                    AppleLink:    APPLE.BUGS
  16. ;
  17. ;
  18.     IF &TYPE('__PROCESSES__') = 'UNDEFINED' THEN
  19. __PROCESSES__ SET 1
  20.  
  21.     IF &TYPE('__TYPES__') = 'UNDEFINED' THEN
  22.     include 'Types.a'
  23.     ENDIF
  24.     IF &TYPE('__EVENTS__') = 'UNDEFINED' THEN
  25.     include 'Events.a'
  26.     ENDIF
  27.     IF &TYPE('__FILES__') = 'UNDEFINED' THEN
  28.     include 'Files.a'
  29.     ENDIF
  30.     IF FOR_SYSTEM8_PREEMPTIVE THEN
  31.     IF &TYPE('__KERNEL__') = 'UNDEFINED' THEN
  32.     include 'Kernel.a'
  33.     ENDIF
  34.     IF &TYPE('__FILEMANAGERTYPES__') = 'UNDEFINED' THEN
  35.     include 'FileManagerTypes.a'
  36.     ENDIF
  37.     ENDIF
  38. ;  type for unique process identifier 
  39. ProcessSerialNumber        RECORD 0
  40. highLongOfPSN             ds.l    1                ; offset: $0 (0)
  41. lowLongOfPSN             ds.l    1                ; offset: $4 (4)
  42. sizeof                     EQU *                    ; size:   $8 (8)
  43.                         ENDR
  44. ; typedef struct ProcessSerialNumber *    ProcessSerialNumberPtr
  45.  
  46.  
  47.                                                             ; Process identifier - Various reserved process serial numbers 
  48. kNoProcess                        EQU        0
  49. kSystemProcess                    EQU        1
  50. kCurrentProcess                    EQU        2
  51.     IF FOR_SYSTEM8_PREEMPTIVE THEN
  52.  
  53.                                                             ; supported versions for GetApplicationInformation
  54. kApplicationInformationVersion    EQU        1
  55. ApplicationInformation    RECORD 0
  56. primaryTaskID             ds.l    1                ; offset: $0 (0)
  57. applicationLauncher         ds.l    1                ; offset: $4 (4)
  58. applicationFile             ds.l    1                ; offset: $8 (8)
  59. sizeof                     EQU *                    ; size:   $C (12)
  60.                         ENDR
  61. ; typedef struct ApplicationInformation * ApplicationInformationPtr
  62.  
  63. ;
  64. ; extern OSStatus GetApplicationInformation(KernelProcessID theProcessID, PBVersion version, ApplicationInformation *appInfo)
  65. ;
  66.     IF GENERATINGCFM THEN
  67.         IMPORT_CFM_FUNCTION GetApplicationInformation
  68.     ENDIF
  69.  
  70.  
  71.                                                             ; supported versions for LaunchInformation structure
  72. kLaunchInformationVersion        EQU        1
  73. LaunchInformation        RECORD 0
  74. kernelProcessID             ds.l    1                ; offset: $0 (0)
  75. sizeof                     EQU *                    ; size:   $4 (4)
  76.                         ENDR
  77. ; typedef struct LaunchInformation *    LaunchInformationPtr
  78.  
  79. ;  for now, the launch call only supports an application in the FSObjectSpecification
  80. ;
  81. ; extern OSStatus Launch(FSObjectRef theFSObjectRef, PBVersion version, LaunchInformation *launchInfo)
  82. ;
  83.     IF GENERATINGCFM THEN
  84.         IMPORT_CFM_FUNCTION Launch
  85.     ENDIF
  86.  
  87. ;
  88. ; extern OSStatus GetKernelProcessIDFromPSN(const ProcessSerialNumber *PSN, KernelProcessID *kernelProcessID)
  89. ;
  90.     IF GENERATINGCFM THEN
  91.         IMPORT_CFM_FUNCTION GetKernelProcessIDFromPSN
  92.     ENDIF
  93.  
  94. ;
  95. ; extern OSStatus GetPSNFromKernelProcessID(KernelProcessID kernelProcessID, ProcessSerialNumber *PSN)
  96. ;
  97.     IF GENERATINGCFM THEN
  98.         IMPORT_CFM_FUNCTION GetPSNFromKernelProcessID
  99.     ENDIF
  100.  
  101.     ENDIF
  102. ;  Definition of the parameter block passed to _Launch 
  103. ;
  104. ; Typedef and flags for launchControlFlags field
  105. ; #if FOR_SYSTEM7_AND_SYSTEM8_DEPRECATED??
  106. ;
  107. ; typedef unsigned short                 LaunchFlags
  108.  
  109.  
  110. launchContinue                    EQU        $4000
  111. launchNoFileFlags                EQU        $0800
  112. launchUseMinimum                EQU        $0400
  113. launchDontSwitch                EQU        $0200
  114. launchAllow24Bit                EQU        $0100
  115. launchInhibitDaemon                EQU        $0080
  116. ;
  117. ; Format for first AppleEvent to pass to new process.  The size of the overall
  118. ;  buffer variable: the message body immediately follows the messageLength 
  119. ;
  120. AppParameters            RECORD 0
  121. theMsgEvent                 ds        EventRecord        ; offset: $0 (0)
  122. eventRefCon                 ds.l    1                ; offset: $10 (16)
  123. messageLength             ds.l    1                ; offset: $14 (20)
  124. sizeof                     EQU *                    ; size:   $18 (24)
  125.                         ENDR
  126. ; typedef struct AppParameters *        AppParametersPtr
  127.  
  128. ;  Parameter block to _Launch 
  129. LaunchParamBlockRec        RECORD 0
  130. reserved1                 ds.l    1                ; offset: $0 (0)
  131. reserved2                 ds.w    1                ; offset: $4 (4)
  132. launchBlockID             ds.w    1                ; offset: $6 (6)
  133. launchEPBLength             ds.l    1                ; offset: $8 (8)
  134. launchFileFlags             ds.w    1                ; offset: $C (12)
  135. launchControlFlags         ds.w    1                ; offset: $E (14)
  136. launchAppSpec             ds.l    1                ; offset: $10 (16)
  137. launchProcessSN             ds        ProcessSerialNumber ; offset: $14 (20)
  138. launchPreferredSize         ds.l    1                ; offset: $1C (28)
  139. launchMinimumSize         ds.l    1                ; offset: $20 (32)
  140. launchAvailableSize         ds.l    1                ; offset: $24 (36)
  141. launchAppParameters         ds.l    1                ; offset: $28 (40)
  142. sizeof                     EQU *                    ; size:   $2C (44)
  143.                         ENDR
  144. ; typedef struct LaunchParamBlockRec *    LaunchPBPtr
  145.  
  146. ;
  147. ; Set launchBlockID to extendedBlock to specify that extensions exist.
  148. ; Set launchEPBLength to extendedBlockLen for compatibility.
  149. ;
  150.  
  151. extendedBlock                    EQU        $4C43                ; 'LC' 
  152. extendedBlockLen                EQU        32
  153.  
  154.                                                             ; Definition of the information block returned by GetProcessInformation 
  155. modeLaunchDontSwitch            EQU        $00040000
  156. modeDeskAccessory                EQU        $00020000
  157. modeMultiLaunch                    EQU        $00010000
  158. modeNeedSuspendResume            EQU        $00004000
  159. modeCanBackground                EQU        $00001000
  160. modeDoesActivateOnFGSwitch        EQU        $00000800
  161. modeOnlyBackground                EQU        $00000400
  162. modeGetFrontClicks                EQU        $00000200
  163. modeGetAppDiedMsg                EQU        $00000100
  164. mode32BitCompatible                EQU        $00000080
  165. modeHighLevelEventAware            EQU        $00000040
  166. modeLocalAndRemoteHLEvents        EQU        $00000020
  167. modeStationeryAware                EQU        $00000010
  168. modeUseTextEditServices            EQU        $00000008
  169. modeDisplayManagerAware            EQU        $00000004
  170. ;  Record returned by GetProcessInformation 
  171. ProcessInfoRec            RECORD 0
  172. processInfoLength         ds.l    1                ; offset: $0 (0)
  173. processName                 ds.l    1                ; offset: $4 (4)
  174. processNumber             ds        ProcessSerialNumber ; offset: $8 (8)
  175. processType                 ds.l    1                ; offset: $10 (16)
  176. processSignature         ds.l    1                ; offset: $14 (20)
  177. processMode                 ds.l    1                ; offset: $18 (24)
  178. processLocation             ds.l    1                ; offset: $1C (28)
  179. processSize                 ds.l    1                ; offset: $20 (32)
  180. processFreeMem             ds.l    1                ; offset: $24 (36)
  181. processLauncher             ds        ProcessSerialNumber ; offset: $28 (40)
  182. processLaunchDate         ds.l    1                ; offset: $30 (48)
  183. processActiveTime         ds.l    1                ; offset: $34 (52)
  184. processAppSpec             ds.l    1                ; offset: $38 (56)
  185. sizeof                     EQU *                    ; size:   $3C (60)
  186.                         ENDR
  187. ; typedef struct ProcessInfoRec *        ProcessInfoRecPtr
  188.  
  189. ;  #endif // FOR_SYSTEM7_AND_SYSTEM8_DEPRECATED??
  190.     IF FOR_SYSTEM7_AND_SYSTEM8_DEPRECATED THEN
  191. ;
  192. ; pascal OSErr LaunchApplication(LaunchPBPtr LaunchParams)
  193. ;
  194.     IF ¨ GENERATINGCFM THEN
  195.         ; parameters:
  196.         ;    LaunchParams    => A0
  197.         ; returns:
  198.         ;    OSErr           <= D0
  199.         _LaunchApplication:    OPWORD    $A9F2
  200.     ELSE
  201.         IMPORT_CFM_FUNCTION LaunchApplication
  202.     ENDIF
  203.  
  204. ;
  205. ; pascal OSErr LaunchDeskAccessory(const FSSpec *pFileSpec, ConstStr255Param pDAName)
  206. ;
  207.     IF ¨ GENERATINGCFM THEN
  208.         Macro
  209.         _LaunchDeskAccessory
  210.             move.w              #$0036,-(sp)
  211.             dc.w                $A88F
  212.         EndM
  213.     ELSE
  214.         IMPORT_CFM_FUNCTION LaunchDeskAccessory
  215.     ENDIF
  216.  
  217. ;
  218. ; pascal OSErr GetCurrentProcess(ProcessSerialNumber *PSN)
  219. ;
  220.     IF ¨ GENERATINGCFM THEN
  221.         Macro
  222.         _GetCurrentProcess
  223.             move.w              #$0037,-(sp)
  224.             dc.w                $A88F
  225.         EndM
  226.     ELSE
  227.         IMPORT_CFM_FUNCTION GetCurrentProcess
  228.     ENDIF
  229.  
  230. ;
  231. ; pascal OSErr GetFrontProcess(ProcessSerialNumber *PSN)
  232. ;
  233.     IF ¨ GENERATINGCFM THEN
  234.         Macro
  235.         _GetFrontProcess
  236.             moveq               #-1,D0
  237.             move.l              D0,-(sp)
  238.             move.w              #$0039,-(sp)
  239.             dc.w                $A88F
  240.         EndM
  241.     ELSE
  242.         IMPORT_CFM_FUNCTION GetFrontProcess
  243.     ENDIF
  244.  
  245. ;
  246. ; pascal OSErr GetNextProcess(ProcessSerialNumber *PSN)
  247. ;
  248.     IF ¨ GENERATINGCFM THEN
  249.         Macro
  250.         _GetNextProcess
  251.             move.w              #$0038,-(sp)
  252.             dc.w                $A88F
  253.         EndM
  254.     ELSE
  255.         IMPORT_CFM_FUNCTION GetNextProcess
  256.     ENDIF
  257.  
  258. ;
  259. ; pascal OSErr GetProcessInformation(const ProcessSerialNumber *PSN, ProcessInfoRec *info)
  260. ;
  261.     IF ¨ GENERATINGCFM THEN
  262.         Macro
  263.         _GetProcessInformation
  264.             move.w              #$003A,-(sp)
  265.             dc.w                $A88F
  266.         EndM
  267.     ELSE
  268.         IMPORT_CFM_FUNCTION GetProcessInformation
  269.     ENDIF
  270.  
  271. ;
  272. ; pascal OSErr SetFrontProcess(const ProcessSerialNumber *PSN)
  273. ;
  274.     IF ¨ GENERATINGCFM THEN
  275.         Macro
  276.         _SetFrontProcess
  277.             move.w              #$003B,-(sp)
  278.             dc.w                $A88F
  279.         EndM
  280.     ELSE
  281.         IMPORT_CFM_FUNCTION SetFrontProcess
  282.     ENDIF
  283.  
  284. ;
  285. ; pascal OSErr WakeUpProcess(const ProcessSerialNumber *PSN)
  286. ;
  287.     IF ¨ GENERATINGCFM THEN
  288.         Macro
  289.         _WakeUpProcess
  290.             move.w              #$003C,-(sp)
  291.             dc.w                $A88F
  292.         EndM
  293.     ELSE
  294.         IMPORT_CFM_FUNCTION WakeUpProcess
  295.     ENDIF
  296.  
  297. ;
  298. ; pascal OSErr SameProcess(const ProcessSerialNumber *PSN1, const ProcessSerialNumber *PSN2, Boolean *result)
  299. ;
  300.     IF ¨ GENERATINGCFM THEN
  301.         Macro
  302.         _SameProcess
  303.             move.w              #$003D,-(sp)
  304.             dc.w                $A88F
  305.         EndM
  306.     ELSE
  307.         IMPORT_CFM_FUNCTION SameProcess
  308.     ENDIF
  309.  
  310.     ENDIF
  311.     IF FOR_SYSTEM7_AND_SYSTEM8_COOPERATIVE THEN
  312.     IF ¨ OLDROUTINELOCATIONS THEN
  313. ;
  314. ; pascal void ExitToShell(void )
  315. ;
  316.     IF ¨ GENERATINGCFM THEN
  317.         _ExitToShell:    OPWORD    $A9F4
  318.     ELSE
  319.         IMPORT_CFM_FUNCTION ExitToShell
  320.     ENDIF
  321.  
  322.     ENDIF
  323.     ENDIF
  324.     ENDIF ; __PROCESSES__ 
  325.  
  326.